package com.tools.Fisco_tools;

import com.common.LO.CompanyInformationLO;
import com.common.LO.UserInformationLO;
import com.tools.Fisco.CompanyInfo;
import org.fisco.bcos.sdk.model.TransactionReceipt;

import java.math.BigInteger;

public class CompanyInfo_tools {
    public static String insert (CompanyInfo companyInfo , CompanyInformationLO companyInformation){
        BigInteger Balance = new BigInteger( String.valueOf(companyInformation.getBalance()));
        BigInteger Account_status = new BigInteger(String.valueOf(companyInformation.getAccountStatus()));
        CompanyInfo.Struct0 select = new CompanyInfo.Struct0(
                companyInformation.getId(),
                companyInformation.getAccount(),
                companyInformation.getPassword(),
                Balance,
                Account_status,
                companyInformation.getName(),
                companyInformation.getRegisterAccount(),
                companyInformation.getRegisterId(),
                companyInformation.getPhone(),
                companyInformation.getCompanyCreateDate(),
                companyInformation.getUnifiedSocialCreditCode(),
                companyInformation.getCreateDate(),
                companyInformation.getUpdateDate(),
                companyInformation.getCompanyBusiness(),
                companyInformation.getCompanyIntroduce(),
                companyInformation.getCompanyAddress(),
                companyInformation.getCompanyEmail()
        );
        TransactionReceipt insert = companyInfo.insert(select);
        return insert.getTransactionHash();
    }

}
